Skip to content

Harden child output collection#21

Open
wolfy-j wants to merge 7 commits into
feat/signal-timeoutfrom
fix/child-output-collection
Open

Harden child output collection#21
wolfy-j wants to merge 7 commits into
feat/signal-timeoutfrom
fix/child-output-collection

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Status: awaiting owner review.

Root cause:

  • Parent nodes collected embedded-child output through loose child node_id output lookups, which allowed races, stale reads, and silent empty completions.
  • The shared child_output helper also needed its json module binding, and cycle needed to preserve template context when strict collection returned a structured child failure.

Strict collection contract:

  • Parents use the run_node_results returned by n:yield.
  • child_output resolves those exact node.result rows, then resolves routed node.output rows from the result envelope data_ids.
  • Structured result envelopes with no data_ids do not trigger node_id guessing.
  • Legacy non-envelope fallback is scoped to the exact returned result row node_id.
  • Output and error routing preserve target-provided data_id values so result envelopes match durable rows.

Failure modes fixed:

  • Late child output now resolves from durable yield-returned result IDs instead of racing node output visibility.
  • Crash recovery with pending children resumes and collects durable child output instead of completing empty.
  • Cycle template child failures keep cycle/template failure context.

Test evidence:

  • Initial full suite from owner WIP: 727 passed, 121 failed.
  • After binding child_output json: 899 passed, 1 failed.
  • Final full suite: make test -> 900 tests passed in 208.0s.

DESIGN_REVIEW.md summary:

  • Documents the yield-result collection contract, invariants, file-level changes, risks, and design-gap record.
  • No strict-contract design gaps were found; observed failures were implementation issues fixed in this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant